practical implementation of deque using python